#!/bin/sh -vx
# $Id$
# Copyright 2019 Karl Berry <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.
# Test strange program name qualifiers which should give warnings.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_kpsewhich=$BinDir/kpsewhich$ExeExt

cnf_dir=$srcdir/tests/cnfprog

# But for the rest, just use the environment, to keep things simpler.
TEXMFCNF=$cnf_dir; export TEXMFCNF

# Make sure we get expected values from the test texmf.cnf.
errfile=cnfprog.err
val=`$_kpsewhich "--cnf-line=TEXMFCNF=$cnf_dir" --var-value=noequals 2>$errfile`
if [ "$ExeExt" = ".exe" ]; then val=`echo $val | sed -e 's/\\r//'`; fi

# the vaiable should not have any value.
test -z "$val" || exit 1

grep 'Empty program name qualifier' $errfile || exit 2
grep 'Unlikely character ;' $errfile || exit 3
grep 'Unlikely character \$' $errfile || exit 4

exit 0
